package _10_i;

import java.util.Scanner;

/**
 * @author ：Rwto
 * @date ：Created in 2021/7/6 15:55
 * @description：斐波那契数列
 * 结果：通过。自底向上动态规划
 */
public class Solution {
    public int fib(int n){
        if(n<1)return n;
        int f0 = 0;
        int f1 = 1;
        int res;
        for(int i=2;i<=n;i++){
            res= (f1+f0)%1000000007;
            f0 = f1;
            f1 = res;
        }
        return f1;
    }

    public static void main(String[] args) {


        Scanner sca = new Scanner(System.in);
        while(true){

            int num = sca.nextInt();
            if(num<0)break;
            System.out.println(new Solution().fib(num));
        }
    }
}
